extern "C"
{
__int16 __stdcall hex_a(unsigned char *hex,char *a,unsigned int length);
__int16 __stdcall a_hex(char *a,unsigned char *hex,unsigned int len);

//串口操作

int __stdcall  OpenCom(__int16 port,long baud);
int __stdcall CloseCom();

int  __stdcall Net_Connect(char *HostIp,int HostPort,
					 char *ReaderIp,int ReaderPort);

int __stdcall Handshake(unsigned char DevcieAddr,unsigned char CmdData,unsigned char &ReaderType,
			unsigned char &ComMode);

int __stdcall Get_Version(unsigned char DevcieAddr,unsigned char *Version);
int __stdcall Get_SerNum(unsigned char DevcieAddr,unsigned char *SerNum);

//format
__int16 __stdcall hex_a(unsigned char *hex,char *a,unsigned int length);
__int16 __stdcall a_hex(char *a,unsigned char *hex,unsigned int len);

//MI10_MB
int __stdcall UhfReadId(unsigned char DevcieAddr,unsigned char mem, unsigned char Addr, unsigned char len, unsigned char *Mask, 
			unsigned char *TagCount, unsigned char *DataLen, unsigned char *Data);
int __stdcall UhfSetWorkMode(unsigned char DevcieAddr,unsigned char mode);
int __stdcall UhfGetWorkMode(unsigned char DevcieAddr,unsigned char &mode);

int __stdcall UhfSetPower(unsigned char DevcieAddr,unsigned char PowerValue);
int __stdcall UhfGetPower(unsigned char DevcieAddr,unsigned char &PowerValue);


int __stdcall UhfSetAntenna(unsigned char DevcieAddr,unsigned char Antenna);
int __stdcall UhfSetBaudRate(unsigned char DevcieAddr,unsigned char baud);
int __stdcall UhfSetTime(unsigned char DevcieAddr,unsigned char time);

int __stdcall UhfSetAddress(unsigned char DevcieAddr,unsigned char addr);
int __stdcall UhfGetAddress(unsigned char DevcieAddr,unsigned char &addr);

int __stdcall UhfSetWeigand(unsigned char DevcieAddr,unsigned char Value);
int __stdcall UhfGetWeigand(unsigned char DevcieAddr,unsigned char &Value);


int __stdcall UhfSetTriggerTime(unsigned char DevcieAddr,unsigned char TimeValue);
int __stdcall UhfGetTriggerTime(unsigned char DevcieAddr,unsigned char &TimeValue);

int __stdcall UhfSetOutPower(unsigned char DevcieAddr,unsigned char PowerValue);
int __stdcall UhfGetOutPower(unsigned char DevcieAddr,unsigned char &PowerValue);


int __stdcall UhfSetBuzzer(unsigned char DevcieAddr,unsigned char value);
int __stdcall UhfGetBuzzer(unsigned char DevcieAddr,unsigned char &value);



int __stdcall UhfGetConfig(unsigned char DevcieAddr,unsigned char *config);
int __stdcall UhfReadBasicParam(unsigned char *pParam);
int __stdcall UhfWriteBasicParam(unsigned char *pParam);
int __stdcall UhfStopAutoReadEPC(unsigned char *pParam);
int __stdcall UhfGetReaderVerison(unsigned char *Verison);

int __stdcall UhfGetListTagId(unsigned char BeginTagNum,unsigned char Number,
			unsigned char *TagCount, unsigned char *DataLen, unsigned char *Data);

int __stdcall UhfSetPassword(unsigned char DevcieAddr,unsigned char EnbleValue,
			unsigned char *Password);
	int __stdcall UhfGetPassword(unsigned char DevcieAddr,unsigned char &EnbleValue,
						unsigned char *Password);


int __stdcall UhfSetReadTagIntervalTime(unsigned char DevcieAddr,unsigned char TimeValue);
int __stdcall UhfGetReadTagIntervalTime(unsigned char DevcieAddr,unsigned char &TimeValue);

int __stdcall UhfSetWgOutByte(unsigned char DevcieAddr,unsigned char *Value);
int __stdcall UhfGetWgOutByte(unsigned char DevcieAddr,unsigned char *Value);

int __stdcall UhfSetWgIntervalTime(unsigned char DevcieAddr,unsigned char time);
int __stdcall UhfGetWgIntervalTime(unsigned char DevcieAddr,unsigned char &time);


int __stdcall UhfSetFrequencyRegion(unsigned char DevcieAddr,unsigned char Region,
					int StartFreq,int EndFreq,int FreqSpace,
					unsigned char FreqQuantity);

int __stdcall UhfGetFrequencyRegion(unsigned char DevcieAddr,unsigned char &Region,
					int &StartFreq,int &EndFreq,int &FreqSpace,
					unsigned char &FreqQuantity);

int __stdcall UhfReadTag(unsigned char DevcieAddr,unsigned char *_Data,unsigned char &DataLen);

int __stdcall UhfFactoryDefault(unsigned char DevcieAddr);

//EPC 输出选择  0 正向，1 反向
int __stdcall EpcOutput(unsigned char *InputEpc,unsigned char InputEpcLen,unsigned char Direction,unsigned char StartAddr,
			unsigned char OutputLen,unsigned char *OutputEpc);


}